home *** CD-ROM | disk | FTP | other *** search
/ Network Support Library / RoseWare - Network Support Library.iso / apidev / tpapi.exe / EXAMPLES / CAPQUEUE.PAS < prev    next >
Pascal/Delphi Source File  |  1994-01-14  |  3KB  |  82 lines

  1. {***************************************************************************}
  2. {** Program : CAPQUEUE                                                    **}
  3. {***************************************************************************}
  4. {** Version : 1.0             ** Started :           ** Ended :           **}
  5. {***************************************************************************}
  6. {******************************** Description ******************************}
  7. {***************************************************************************}
  8. {** Program to show direct printing to a Netware print queue.             **}
  9. {**                                                                       **}
  10. {**                                                                       **}
  11. {**                                                                       **}
  12. {**                                                                       **}
  13. {**                                                                       **}
  14. {**                                                                       **}
  15. {**                                                                       **}
  16. {***************************************************************************}
  17. {******************************** Information ******************************}
  18. {***************************************************************************}
  19. {**                                                                       **}
  20. {**                                                                       **}
  21. {**                                                                       **}
  22. {**                                                                       **}
  23. {**                                                                       **}
  24. {**                                                                       **}
  25. {***************************************************************************}
  26.  
  27. {$X+}
  28.  
  29. program CAPQUEUE;
  30.  
  31. uses
  32.  
  33.   nwvar,
  34.   nwbindry,
  35.   nwqueue,
  36.   nwmisc,
  37.   objects
  38.   ;
  39.  
  40. var
  41.  
  42.   MNW    : MiscFuncOBJ;
  43.   QS     : QueueOBJ;
  44.   BS     : BinderyOBJ;
  45.   JS     : JobStruct286;
  46.   FileH  : FileOfText;
  47.   Queues : PStringCollection;
  48.   NoOfQs : word;
  49.   QueueID: OT_binderyID;
  50.  
  51. begin
  52.  
  53.   QS.Init (true);
  54.   BS.Init (true);
  55.   MNW.Init (true);
  56.  
  57.   Queues := new (PStringCollection, Init (5, 10));
  58.   MNW.GetAllObjects ('*', OT_PrintQueue, Queues, NoOfQs);
  59.   BS.GetBinderyObjectID (PString (Queues^.At (0))^, OT_PrintQueue, QueueID);
  60.   with JS do
  61.     begin
  62.  
  63.       fillchar (JS, sizeof (JS), 0);
  64.       TargetServerObjectID := -1;
  65.       fillchar (TargetExecutionTime, 6, 255);
  66.       JobType := 0;
  67.       JobControlFlags := $8;
  68.  
  69.     end;
  70.  
  71.   QS.CreateQueueJobAndFileText (QueueID, JS, FileH);
  72.   writeln (FileH, 'THIS IS A TEST PRINT OUT DIRECT TO A FILE IN A PRINT QUEUE.');
  73.   writeln (FileH, 'CHECK OUT CAPQUEUE.PAS');
  74.   QS.CloseFileAndStartQueueJobText (QueueID, JS.JobNumber, FileH);
  75.  
  76.   QS.Done;
  77.   BS.Done;
  78.   MNW.Done;
  79.  
  80. end.
  81.  
  82.